<?php
	require_once(dirname(__FILE__)."/include/blog_home_data.php");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh" xml:lang="zh">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title><?php echo $menu_blog; ?></title>
	<link rel="stylesheet" type="text/css" href="css/common.css" />
	<script type="text/javascript" src = "./js/utility.js"> </script>
	<script type="text/javascript" src = "./js/search.js"> </script>
</head>
<body style="background-color:white">
	<table align="center" style="width:<?php echo $width;?>" border="0">
		<tr>
			<td> <?php require_once("header.php");?> </td>
		</tr>
		<tr>
			<td >
				<table align="center" style="width:95%; padding:30px 0px 0px 20px;background-color:#ffffff;" border="0">
					<tr>
						<td style="padding-bottom: 10px">
							<div class="blog_header">
								<div style="float:left">
									<img src="./skins/blog_logo.gif" atl="logo" />
								</div>
								<div style="float:left;padding-top:5px;padding-left:5px">
									欢迎来到解题报告系统
								</div>
								<div style="float:right;">
									<form>
										<input type="text" class="search_input" value="标题|作者|关键字|年月(如2014-01)" onblur="killfocus()" onfocus="setfocus()" required="required" id="keyword" />
										<input type="submit" value="快速检索" class="btn" onclick="query(); return false;" />
										<input type="button" value="添加文章" class="btn" onclick="javascript:window.location='./blog_add_page.php';"/>

										<?php if(!isset($_SESSION["user"])) { ?>
										<input type="button" value="登录" class="btn" onclick="Redirect('./loginpage.php')" />
										<input type="button" value="注册" class="btn" onclick="Redirect('./register.php')" />
										<?php } ?>
									</form>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td >
							<div class="blog_content">
								<table style="width:100%">
									<tr valign="top">
										<td style="width:20%; padding:5px 10px 5px 10px;">
											<ul class="sub_header">
												<span>文章算法分类</span>
											</ul>
											<ul class="sub_body">
												<?php
													foreach($PageArray["algo_classlist"] as $Object){ 
												?>
												<li class="sub_body_item"><a href="./blog_list_display.php?cid=<?php echo $Object->id?>">
													<?php echo $Object->name."(".$Object->cnt.")";?>
													</a>
												</li>
												<?php
													}
												?>
											</ul>
										</td>
										<td style="width:60%; padding:5px 10px 5px 10px;">
											<ul class="sub_header">
												<span>最新动态</span>
											</ul>
											<div class="sub_content">
												<?php
													foreach($PageArray["new_bloglist"] as $Object){ 
												?>
												<li class="sub_content_item">
													<?php echo $Object->in_time; ?> 作者
													<a href="userinfo.php?user=<?php echo $Object->user; ?>"> <?php echo $Object->user; ?></a>
													发表了
													<a href="./blog_display.php?bid=<?php echo $Object->id;?>">
														<?php echo $Object->title;?>
													</a>
													这篇博文，大家快来围观~~~
												</li>
												<?php
													}
												?>
											</div>
										</td>
										<td style="width:20%;padding:5px 10px 5px 10px;">
											<ul class="sub_header">
												<span>文章存档</span>
											</ul>
											<ul class="sub_body">
												<?php
													foreach($PageArray["date_bloglist"] as $Object){ 
												?>
												<li class="sub_body_item"><a href="./blog_list_display.php?date=<?php echo $Object->date; ?>">
													<?php echo $Object->datestr."(".$Object->cnt.")";?>
													</a>
												</li>
												<?php
													}
												?>
											</ul>
										</td>
									</tr>
								</table>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td style="padding-top:50px">
				<?php require_once("footer.php") ?></td>
		</tr>
	</table>
</body>
</html>